﻿namespace LeRenard.ScriptWars.Model.Scripting.Definitions
{
    public class OperationParameterDefinition : IOperationParameterDefinition
    {
        #region Properties
        /// <summary>
        /// The name of the parameter.
        /// </summary>
        public string Name { get { return _name; } }
        private readonly string _name;

        /// <summary>
        /// Gets the operation parameter's type.
        /// </summary>
        public OperationParameterType Type { get { return _type; } }
        private readonly OperationParameterType _type;
        #endregion

        #region Construction
        /// <summary>
        /// Creates a new <see cref="OperationParameterDefinition"/> object.
        /// </summary>
        /// <param name="name">Name of the parameter.</param>
        /// <param name="type">Type of the parameter.</param>
        internal OperationParameterDefinition(string name, OperationParameterType type)
        {
            ThrowIf.NullOrEmpty(() => name);

            _name = name;
            _type = type;
        }
        #endregion
    }
}
